package com.xuanwu.ai.flow.controller;

import com.xuanwu.ai.flow.model.AIComponent;
import com.xuanwu.ai.flow.service.ComponentServiceImpl;
import com.xuanwu.ai.web.views.ResponseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(value = "组件相关接口", produces = "application/json")
@RestController
@RequestMapping("/component")
@Slf4j
public class ComponentController {

    @Autowired
    private ComponentServiceImpl componentService;

    @PostMapping("/getList")
    @ApiOperation(value = "获取组件列表", notes = "获取组件列表")
    public ResponseVo<List<AIComponent>> getCmpList() {

        return ResponseVo.success(componentService.getComponentList());
    }
}
